<#assign className = table.className>   
<#assign classNameLower = className?uncap_first>
<% 
DIRECTIVE SAFE_OUTPUT_OPEN;
var headContent = {
	include("/pages/template/head.html"){}
%>
<script type="text/javascript">
	var oper = {
		save:function(id){
			if(!validForm()) {
				return false;
			}
			id = id || '0';
			var url = 'admin/${namespace}/save/'+id;
			form1.action = url;
			form1.submit();
			return true;
		}	
	};
</script>

<%
};
var bodyContent = {
%>
<div class="container">
	<br>
	<form name="form1"  method="post" class="form-horizontal"
			role="form" >
		<input type="hidden" name="model.id" value="${r'${model.id}'}" />
		  <#list table.columns as column>	
		  <div class="form-group">
		    <label for="${column.sqlName}" class="col-sm-2 control-label">${column.remarks}</label>
		    <div class="col-sm-10">
				<input class="form-control" id="${column.sqlName}" type="text" name="model.${column.sqlName}" value="${'$'}{model.${column.sqlName}!''}"  valid='vtext' validname='${column.remarks}'  />
		    </div>
		  </div>
		  </#list>
		  <div class="form-group">
		    <div class="col-sm-offset-2 col-sm-10">
		      <button class="btn btn-primary" onclick="return oper.save(${r'${model.id}'});">保 存</button>
			  <button class="btn btn-default" onclick="closeIframe();return false;">关 闭</button>
		    </div>
		  </div>
	
	</form>
</div>
<%}; %>

<% layout("/pages/template/_layout.html",{head:headContent,body:bodyContent}){ %>
<%}
DIRECTIVE SAFE_OUTPUT_CLOSE; 
%>